#include <sys/types.h>
#include <dirent.h>
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
    const char * filepath = "/home/259ClassBasic/262班/OperationSystem/IOOperation";

    DIR *dir =  opendir(filepath);
    if(dir == NULL)
    {
        perror("open dir error:");
        return -1;
    }

    struct dirent * content = NULL;

    while((content = readdir(dir))!=NULL)
    {   
        if((int)content->d_type == 8)
        {
            cout<<"name:"<<content->d_name<<"type:"<<(int)content->d_type<<endl;
        }
        
    }
    closedir(dir);
    return 0;
}